Apparatus and method for supporting connection establishment in an offload of network protocol processing

ABSTRACT

A number of improvements in network adapters that offload protocol processing from the host processor are provided. Specifically, a mechanism for improving connection establishment in a system utilizing an offload network adapter is provided. The connection establishment mechanism provides the ability to offload connection establishment and maintenance of connection state information to the offload network adapter. As a result of this offloading of connection establishment and state information maintenance, the number of communications needed between the host system and the offload network adapter may be reduced. In addition, offloading of these functions to the offload network adapter permits bulk notification of established connections and state information to the host system rather than piecemeal notifications as is present in known computing systems.

RELATED APPLICATIONS

The present application is related to co-pending and commonly assignedU.S. patent application Ser. No. ______ (Attorney Docket No.YOR920040145US1) entitled “Apparatus and Method for Supporting MemoryManagement in an Offload of Network Protocol Processing” and U.S. patentapplication Ser. No. ______ (Attorney Docket No. YOR920040146US1)entitled “Apparatus and Method for Supporting Received Data Processingin an Offload of Network Protocol Processing,” both of which are filedon even date herewith and hereby incorporated by reference.

BACKGROUND OF THE INVENTION

1. Technical Field

The present invention is generally directed to an improved dataprocessing system. More specifically, the present invention is directedto a method and apparatus for supporting connection establishmentoperations in an offload network adapter.

2. Description of Related Art

In known systems, the operating system communicates with a conventionalnetwork interface only in terms of data transfer by providing thenetwork interface with two queues of buffers. A first queue of buffersis made up of descriptors that point to read-made data packets in hostmemory that are read for transmission. A second queue of buffersincludes descriptors that point to buffers filled with unprocessed datapackets in host memory that have been received for processing. Thenetwork interface provides a memory-mapped input/output (I/O) interfacefor informing the network interface where the queues are in physicalmemory and provides an interface for some control information, such aswhat interrupt to generate when a data packet arrives.

Network protocol processing for convention network interfaces isperformed entirely within the host with only data packets being providedto the network adapter for transmission. However, network link speedshave increased faster than the growth of microprocessor performance. Asa result, the host processor becomes burdened with large amounts ofTCP/IP protocol processing, reassembling out-of-order data packets,resource-intensive memory copies, and interrupts. In some high-speednetworks, the host processor has to dedicate more processing to handlethe network traffic than to the applications it is running. Thus, thedata packet is processed in the host at a lower rate than the networkspeed.

In order to address this problem, recent emphasis has been on offloadingthe processing of the TCP/IP protocols from the host processor to thehardware on the network adaptor. Such network adapters, which aresometimes referred to as an intelligent network adapter or a TCP/IPOffload Engine (TOE), can be implemented with a network processor andfirmware, specialized ASICs, or a combination of both. These networkadapters not only offload host processor processing so that applicationperformance is increased, but also enable communication with new typesof networks and devices, such as iSCSI storage area networks (SANs) andhigh performance network attached storage (NAS) applications.

While these network adapters offload the TCP/IP protocol processing ofdata packets, much of the processing that is needed for communicationover networks is still maintained within the host system. For example,the host system is still responsible for establishing connections,maintaining state information for each of the established connections,handling memory management, and the like. Thus, the host system stillexperiences processor load due to these operations having to beperformed in the host system and furthermore, due to the amount ofcommunication that is required between the host system and the networkadapter to perform these operations in the host system. Thus, it wouldbe beneficial to have an apparatus and method for improving theoperation of a network adapter such that the processing load on the hostsystem is minimized and more of the processing is performed in thenetwork adapter.

SUMMARY OF THE INVENTION

The present invention provides number of improvements in networkadapters that offload protocol processing from the host processor,hereafter referred to as an offload network adapter. Specifically, thepresent invention provides mechanisms for handling memory management andoptimization within a system utilizing an offload network adapter. Inaddition, the present invention provides a mechanism for improvingconnection establishment in a system utilizing an offload networkadapter. Furthermore, the present invention provides an improvedmechanism for handling receipt of data packets in system utilizing anoffload network adapter.

One aspect of the present invention is the ability to offload connectionestablishment and maintenance of connection state information to theoffload network adapter. As a result of this offloading of connectionestablishment and state information maintenance, the number ofcommunications needed between the host system and the offload networkadapter may be reduced. In addition, offloading of these functions tothe offload network adapter permits bulk notification of establishedconnections and state information to the host system rather thanpiecemeal notifications as is present in known computing systems.

In addition to connection establishment, the present invention improvesupon memory management in a data processing system that utilizes anoffload network adapter. The memory management according to the presentinvention permits both buffered sending and receiving of data as well aszero-copy sending and receiving of data. In addition, the presentinvention permits grouping of DMA buffers that can be shared amongspecified connections based on any number of attributes. The presentinvention further permits partial send and receive buffer operation,delaying of DMA requests so that they may be communicated to the hostsystem in bulk, and a mechanism for expedited transfer of data to thehost system.

In addition to connection establishment and memory management, thepresent invention improves upon the handling of received data in a dataprocessing system that utilizes an offload network adapter. The offloadnetwork adapter of the present invention may include logic that permitsthe offload network adapter to delay notification of data reception tothe host system in different ways. The advantage of delaying the noticeof data packet reception to the host system is the potential foraggregation of several data packets, which can arrive immediately afterthe first one, for example, in a single notification. Given a streamwith continuous data packet arrival, a value may be set for notificationdelay and this value may be configurable for the host system percommunication socket.

These and other features and advantages of the present invention will bedescribed in, or will become apparent to those of ordinary skill in theart in view of, the following detailed description of the preferredembodiments.

BRIEF DESCRIPTION OF THE DRAWINGS

The novel features believed characteristic of the invention are setforth in the appended claims. The invention itself, however, as well asa preferred mode of use, further objectives and advantages thereof, willbest be understood by reference to the following detailed description ofan illustrative embodiment when read in conjunction with theaccompanying drawings, wherein:

FIG. 1 is an exemplary diagram of a distributed data processing systemin which aspects of the present invention may be implemented;

FIG. 2 is an exemplary diagram of a server computing device in whichaspects of the present invention may be implemented;

FIG. 3 is an exemplary diagram of a client computing device in whichaspects of the present invention may be implemented;

FIG. 4 is an exemplary diagram of a network adapter in accordance withone exemplary embodiment of the present invention;

FIG. 5 is a diagram illustrating TCP/IP processing in a system utilizinga conventional network interface card;

FIG. 6 is a diagram illustrating TCP/IP processing in a system utilizinga TCP/IP Offload Engine or offload network adapter;

FIG. 7 is an exemplary diagram illustrating aspects of one exemplaryembodiment of the present invention with regard to the Offload NetworkAdapter Programming Interface of the present invention;

FIG. 8 is an exemplary diagram illustrating aspects of one exemplaryembodiment of the present invention with regard to establishment of aconnection using an offload network adapter and the Offload NetworkAdapter Programming Interface;

FIG. 9 is a flowchart outlining an exemplary operation of a host systemof the present invention when establishing a connection using an offloadnetwork adapter;

FIG. 10 is a flowchart outlining an exemplary operation of an offloadnetwork adapter when establishing a connection in accordance with oneexemplary embodiment of the present invention;

FIG. 11 is an exemplary diagram illustrating a memory managementmechanism in accordance with the present invention in which bufferedsending and receiving of data is utilized;

FIG. 12 is an exemplary diagram illustrating a zero-copy operation inaccordance with one exemplary embodiment of the present invention;

FIG. 13 is an exemplary diagram illustrating a shared buffer arrangementaccording to one exemplary embodiment of the present invention;

FIG. 14 illustrates the manner by which partial receive/send buffersoperate in accordance with one exemplary embodiment of the presentinvention;

FIG. 15 illustrates an exemplary DMA transfer order decision makingprocess in accordance with one exemplary embodiment of the presentinvention;

FIG. 16 is a flowchart outlining an exemplary operation when sendingdata using a host system and offload network adapter in accordance withaspects of one exemplary embodiment of the present invention;

FIG. 17 is a flowchart outlining an exemplary operation when performinga zero copy transfer of data between a host system and an offloadnetwork adapter in accordance with aspects of one exemplary embodimentof the present invention; and

FIG. 18 is a flowchart outlining an exemplary operation for determiningan application buffer to send data to in accordance with aspects of oneexemplary embodiment of the present invention.

DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT

The present invention is directed to an apparatus and method forimproving the operation of an offload network adapter, i.e. a networkadapter that performs some or all of the network protocol processing andthus, offloads processing from the host. Since the present invention isrelated to offload network adapters, the present invention is especiallywell suited for use with a distributed data processing system having oneor more networks. FIGS. 1-3 are provided as an example of such adistributed data processing environment in which aspects of the presentinvention may be implemented. It should be appreciated that FIGS. 1-3are only exemplary and many modifications to these exemplaryenvironments may be made without departing from the spirit and scope ofthe present invention.

With reference now to the figures, FIG. 1 depicts a pictorialrepresentation of a network of data processing systems in which thepresent invention may be implemented. Network data processing system 100is a network of computers in which the present invention may beimplemented. Network data processing system 100 contains a network 102,which is the medium used to provide communications links between variousdevices and computers connected together within network data processingsystem 100. Network 102 may include connections, such as wire, wirelesscommunication links, or fiber optic cables.

In the depicted example, server 104 is connected to network 102 alongwith storage unit 106. In addition, clients 108, 110, and 112 areconnected to network 102. These clients 108, 110, and 112 may be, forexample, personal computers or network computers. In the depictedexample, server 104 provides data, such as boot files, operating systemimages, and applications to clients 108-112. Clients 108, 110, and 112are clients to server 104. Network data processing system 100 mayinclude additional servers, clients, and other devices not shown. In thedepicted example, network data processing system 100 is the Internetwith network 102 representing a worldwide collection of networks andgateways that use the Transmission Control Protocol/Internet Protocol(TCP/IP) suite of protocols to communicate with one another. At theheart of the Internet is a backbone of high-speed data communicationlines between major nodes or host computers, consisting of thousands ofcommercial, government, educational and other computer systems thatroute data and messages. Of course, network data processing system 100also may be implemented as a number of different types of networks, suchas for example, an intranet, a local area network (LAN), or a wide areanetwork (WAN). FIG. 1 is intended as an example, and not as anarchitectural limitation for the present invention.

Referring to FIG. 2, a block diagram of a data processing system thatmay be implemented as a server, such as server 104 in FIG. 1, isdepicted in accordance with a preferred embodiment of the presentinvention. Data processing system 200 may be a symmetric multiprocessor(SMP) system including a plurality of processors 202 and 204 connectedto system bus 206. Alternatively, a single processor system may beemployed. Also connected to system bus 206 is memory controller/cache208, which provides an interface to local memory 209. 10 bus bridge 210is connected to system bus 206 and provides an interface to 110 bus 212.Memory controller/cache 208 and 110 bus bridge 210 may be integrated asdepicted.

Peripheral component interconnect (PCI) bus bridge 214 connected to I/Obus 212 provides an interface to PCI local bus 216. A number of modemsmay be connected to PCI local bus 216. Typical PCI bus implementationswill support four PCI expansion slots or add-in connectors.Communications links to clients 108-112 in FIG. 1 may be providedthrough modem 218 and network adapter 220 connected to PCI local bus 216through add-in connectors.

Additional PCI bus bridges 222 and 224 provide interfaces for additionalPCI local buses 226 and 228, from which additional modems or networkadapters may be supported. In this manner, data processing system 200allows connections to multiple network computers. A memory-mappedgraphics adapter 230 and hard disk 232 may also be connected to I/O bus212 as depicted, either directly or indirectly.

Those of ordinary skill in the art will appreciate that the hardwaredepicted in FIG. 2 may vary. For example, other peripheral devices, suchas optical disk drives and the like, also may be used in addition to orin place of the hardware depicted. The depicted example is not meant toimply architectural limitations with respect to the present invention.

The data processing system depicted in FIG. 2 may be, for example, anIBM eServer pSeries system, a product of International Business MachinesCorporation in Armonk, N.Y., running the Advanced Interactive Executive(AIX) operating system or LINUX operating system.

With reference now to FIG. 3, a block diagram illustrating a dataprocessing system is depicted in which the present invention may beimplemented. Data processing system 300 is an example of a clientcomputer. Data processing system 300 employs a peripheral componentinterconnect (PCI) local bus architecture. Although the depicted exampleemploys a PCI bus, other bus architectures such as Accelerated GraphicsPort (AGP) and Industry Standard Architecture (ISA) may be used.Processor 302 and main memory 304 are connected to PCI local bus 306through PCI bridge 308. PCI bridge 308 also may include an integratedmemory controller and cache memory for processor 302. Additionalconnections to PCI local bus 306 may be made through direct componentinterconnection or through add-in boards. In the depicted example, localarea network (LAN) adapter 310, SCSI host bus adapter 312, and expansionbus interface 314 are connected to PCI local bus 306 by direct componentconnection. In contrast, audio adapter 316, graphics adapter 318, andaudio/video adapter 319 are connected to PCI local bus 306 by add-inboards inserted into expansion slots. Expansion bus interface 314provides a connection for a keyboard and mouse adapter 320, modem 322,and additional memory 324. Small computer system interface (SCSI) hostbus adapter 312 provides a connection for hard disk drive 326, tapedrive 328, and CD-ROM drive 330. Typical PCI local bus implementationswill support three or four PCI expansion slots or add-in connectors.

An operating system runs on processor 302 and is used to coordinate andprovide control of various components within data processing system 300in FIG. 3. The operating system may be a commercially availableoperating system, such as Windows XP, which is available from MicrosoftCorporation. An object oriented programming system such as Java may runin conjunction with the operating system and provide calls to theoperating system from Java programs or applications executing on dataprocessing system 300. “Java” is a trademark of Sun Microsystems, Inc.Instructions for the operating system, the object-oriented programmingsystem, and applications or programs are located on storage devices,such as hard disk drive 326, and may be loaded into main memory 304 forexecution by processor 302.

Those of ordinary skill in the art will appreciate that the hardware inFIG. 3 may vary depending on the implementation. Other internal hardwareor peripheral devices, such as flash read-only memory (ROM), equivalentnonvolatile memory, or optical disk drives and the like, may be used inaddition to or in place of the hardware depicted in FIG. 3. Also, theprocesses of the present invention may be applied to a multiprocessordata processing system.

As another example, data processing system 300 may be a stand-alonesystem configured to be bootable without relying on some type of networkcommunication interfaces As a further example, data processing system300 may be a personal digital assistant (PDA) device, which isconfigured with ROM and/or flash ROM in order to provide non-volatilememory for storing operating system files and/or user-generated data.

The depicted example in FIG. 3 and above-described examples are notmeant to imply architectural limitations. For example, data processingsystem 300 also may be a notebook computer or hand held computer inaddition to taking the form of a PDA. Data processing system 300 alsomay be a kiosk or a Web appliance.

Turning now to FIG. 4, a diagram of a network adapter is depicted inaccordance with a preferred embodiment of the present invention. Networkadapter 400 may be implemented as a network adapter 220 in FIG. 2, LANadapter 310 in FIG. 3, or the like. As shown, network adapter 400includes Ethernet interface 402, data buffer 404, and PCI bus interface406. These three components provide a path between the network and thebus of the data processing system. Ethernet interface 402 provides aninterface to the network connected to the data processing system. PCIbus interface 406 provides an interface to a bus, such as PCI bus 216 or306. Data buffer 404 is used to store data being transmitted andreceived through network adaptor 400. This data buffer also includes aconnection to an SRAM interface to provide for additional storage.

Network adaptor 400 also includes electrically erasable programmableread-only memory (EEPROM) interface 408,register/configure/status/control unit 410, oscillator 412, and controlunit 414. EEPROM interface 408 provides an interface to an EEPROM chip,which may contain instructions and other configuration information fornetwork adaptor 400. Different parameters and setting may be stored onan EEPROM chip through EEPROM interface 408.Register/configure/status/control unit 410 provides a place to storeinformation used to configure and run processes on network adaptor 400.For example, a timer value for a timer may be stored within theseregisters. Additionally, status information for different processes alsomay be stored within this unit. Oscillator 412 provides a clock signalfor executing processes on network adaptor 400.

Control unit 414 controls the different processes and functionsperformed by network adaptor 400. Control unit 414 may take variousforms. For example, control unit 414 may be a processor or anapplication-specific integrated chip (ASIC). In these examples, theprocesses of the present invention used to manage flow control of dataare executed by control unit 414. If implemented as a processor, theinstructions for these processes may be stored in a chip accessedthrough EEPROM interface 408.

Data is received in receive operations through Ethernet interface 402.This data is stored in data buffer 404 for transfer onto the dataprocessing system across PCI bus interface 406. Conversely, data isreceived from the host system for transmission via the PCI bus interface406 and is stored in the data buffer 404.

In conventional data processing systems, the processing of the data thatis transmitted to/from a host system via a network adapter is performedwithin the host system. FIG. 5 illustrates the manner by whichconventional processing of data packets in a TCP/IP protocol stack isperformed. As shown in FIG. 5, the application software 510 sends andreceives data via the operating system 520 and the network adapter 530.Processing of the data through the TCP/IP protocol stack is performedwith the operating system 520 performing TCP/IP protocol processing toeither generate formatted data packets for transmission or extract androute the data in a data packet to an appropriate application 510. Theseoperations are performed in software on the host system.

The formatted data packets are sent/received in hardware via the networkadapter 530. The network adapter 530 operates on the data packets from amedia access control and physical layer. The media access control layeris the services that control access to the physical transmission mediumon a network. MAC layer functionality is built into the network adapterand includes a unique serial number that identifies each networkadapter. The physical layer is the layer that provides services fortransmission of bits over the network medium.

As shown in FIG. 5, in a conventional network interface, when data is tobe sent over the network from the host system, the data is first copiedfrom an application buffer 540 in user space into a pinned kernel buffer550 and an entry in a network adapter queue 560 is generated for queuingthe data to the network adapter 530 for transmission. When data isreceived from the network for an application 510 on the host system, thedata packet is written to the host kernel buffer 540 using a directmemory access (DMA) operation. The data is then later copied by the hostinto the application's buffer 540 in user space when the applicationcalls receive( ).

FIG. 6 illustrates the manner by which an offload network adapterprocesses data packets in a TCP/IP protocol stack. As shown in FIG. 6,the TCP and IP processing that is conventionally performed in theoperating system 620 of the host system is moved so that it is performedwithin the offload network adapter 630. As a result, the processingperformed by the host system is reduced such that the applications 610may be executed more efficiently.

With known offload network adapters, the buffered sends and receivesdescribed above with regard to FIG. 5 are still necessary even thoughthe processing of the TCP/IP stack has been shifted to the networkadapter 630. That is, as shown in FIG. 6, for sending of data packetsfrom the host system, data is first copied from the application's buffer640 in user space to the kernel buffer 650 where it is queued in thenetwork adapter queue 660 for processing by the network adapter.Similarly, with received data packets, the data is DMA'd to the kernelbuffer 650 and at a later time is copied into the application buffer 640in user space.

Thus, as with the convention case above, in known offload networkadapters, there is still a need to copy data between the user spaceapplication buffer 640 and the kernel space kernel buffer 650. Such copyoperations must be performed in the host system for every data packetthat is being sent or received. The overhead associated with such copyoperations reduces the availability of the host processor to runapplications.

In addition, while the TCP/IP protocol processing of data packets may beoffloaded to the offload network adapter 630, actual connectionestablishment and maintaining of state information for each establishedconnection is still the responsibility of the host system, e.g.,operating system 620. That is, the host must still perform the necessaryoperations to establish outbound and inbound connections. In addition,the host must exchange messages with the network adapter as the state ofeach connection changes so that the state information stored in the hostsystem for each connection may be maintained.

As a result, while offloading TCP/IP protocol processing from the hostsystem to the network adapter has improved the throughput of computingsystems, additional improvement may be obtained by improving the mannerby which memory is managed in such offload network adapter systems andimproving the manner by which connections are established such thatconnection establishment is offloaded and messaging between the host andthe network adapter is minimize. Moreover, improvement of the operationof the network adapter may be obtained by improving the manner by whichdata is received in an offload network adapter such that interactionbetween the network adapter and the host system is minimized.

The present invention provides mechanisms for improving the operation ofan offload network adapter such that interaction between the host systemand the network adapter is minimized. The present invention provides animproved interface between the operating system of the host system andthe offload network adapter. This interface includes a control portionand a data portion. The interface makes use of queues of buffers whichare used with explicit data structures that indicate both the controland data portions of the interface. The control portion of the interfaceallows the host system to instruct the offload network adapter andallows the offload network adapter to instruct the host system. Forexample, the host system may instruct the network interface as to whichport numbers to listen to, and the offload network adapter may instructthe host system as to the establishment of a new connection, receipt ofdata, etc. The data portion of the interface provides a mechanism fortransfer of data on established connections both for sending andreceiving. The control portion of the interface may be invoked by usingconventional socket application programming interfaces (APIs) thatcontrol connections, e.g., socket( ), bind( ), listen( ), connect( ),accept( ), setsockopt( ), etc. The data portion of the interface may beinvoked by socket APIs for sending or receiving data, e.g., send( ),sendto( ), write( ), writev( ), read( ), readv( ), etc.

FIG. 7 is an exemplary diagram illustrating communication between thehost system and an offload network adapter using the Offload NetworkAdapter Programming Interface of the present invention. The OffloadNetwork Adapter Programming Interface provides a communication interfacebetween the host system and the offload network adapter that isprimarily based on direct memory access (DMA) operations, or DMAs, forwriting and reading request and response descriptors in reservedportions of I/O accessible memory on the host system.

As shown in FIG. 7, the host system 710 submits requests for datatransfers either to or from the offload network adapter 730, and theoffload network adapter 730 responds with notifications of success orfailure for the requests. Requests and responses are packaged into datastructures called request descriptors and response descriptors. Thedescriptors are written into and read from two physical regions in I/Oaccessible memory 720 on the host system 710. These regions are calledthe input descriptor table 722 and the output descriptor table 724 andare used in a producer-consumer fashion.

The input descriptor table 722 is read by the offload network adapter730 and written to by the host system 710 to submit control and datainterface requests. The output descriptor table 724 is read by the hostsystem 710 and written to by the offload network adapter 730, which usesthe output descriptor table 724 to indicate results of previous requestsand to notify the host system 710 of data arrivals.

While both the host system 710 and the offload network adapter 730 readfrom and write to these descriptor tables 722 and 724, to do not accessthe descriptors in the same way. The host system 710 uses conventionalmemory reads and writes to access the descriptor tables 722 and 724.However, the offload network adapter uses DMA operations to copyarbitrary sets of descriptors to and from the descriptor tables 722 and724.

As with conventional network adapters, the host system 710 may beinformed of new response descriptors in the output descriptor table 724from the offload network adapter 730 by either polling or receivinginterrupts, for example. That is, when a data packet is received in theoffload network adapter, and certain criteria are met for notificationof the arrival of the data packet to the host system 710, as will bediscussed in greater detail hereafter, a response descriptor may begenerated by the offload network adapter 730 and written to the outputdescriptor table 724. An interrupt may then be received by the operatingsystem 715 indicating the new descriptor in the output descriptor table724. Alternatively, the host system 710 may periodically poll the outputdescriptor table 724 for new descriptors. If the output descriptor table724 is in danger of overflowing, the offload network adapter 730 mayraise an interrupt to the host system 710 to notify it of the situation.

In one exemplary embodiment of the present invention, the descriptorsthat are written to the descriptor tables 722 and 724 are 256 bits/32bytes and are structured as follows: descriptor owner (1 bit),descriptor type (5 bits), descriptor content (250 bits). The owner bitis used for the producer/consumer relationship of the descriptor in thedescriptor tables 722 and 724. In other words, since there are twocomponents communicating, e.g., the host operating system and theoffload network adapter a producer/consumer relationship is present. Asingle bit can be used to denote the ownership of the descriptor. Forexample, a “1” may denote a host generated descriptor and a “zero” maydenote an offload network adapter generated descriptor, or vice versa.

The descriptor type identifies the operation and/or request that isassociated with the descriptor. For example, a request descriptor mayconsist of one of the following types: buffer send, buffer available,connect request, termination request, listen request, cancellationrequest, connection attribute control and network adapter attributecontrol.

The buffer send descriptor type is associated with a request to allocatea buffer for storing data to be sent and identifies the buffer, theconnection identifier to use, and the value of an ASAP bit, describedhereafter. The buffer available descriptor type is associated with arequest to allocate a buffer for storing received data and identifies abuffer for storing the received data and the connection identifier overwhich the data is to be received. The connection request descriptor typeis associated with a request to initiate a connection on a specifiedlocal port and protocol. The termination request descriptor type usassociated with a request to tear down a specified connection. Thelisten request descriptor type is associated with a request indicating awillingness to receive connections on a port and protocol. Thecancellation request descriptor type is associated with a request tocancel a previously submitted send, connect or listen request. Theconnection attribute control descriptor type is associated with requeststo get or set connection attributes. The network adapter attributecontrol descriptor type is associated with requests to get or setnetwork adapter-wide attributes.

Response descriptors may have various types as well. For example, aresponse descriptor may be one of the following types: buffer receive,buffer available, connection arrival, connection completion, listenresponse, termination response, cancellation response, connectionattribute, and network adapter attribute. The buffer receive descriptortype identifies a buffer that has data available and identifies whichconnection the data is for. The buffer available descriptor typeidentifies a DMA is complete and that a send buffer is available. Theconnection arrival descriptor type notifies the host that a newconnection has arrived and includes the connection identifier. Theconnection completion descriptor type notifies the host that a connectrequest has succeeded or failed. The listen response descriptor typeindicates the success/failure of a submitted listen request. Thetermination response descriptor type indicates success/failure of asubmitted close request. The cancellation response descriptor typeindicates success/failure of a submitted cancellation request. Theconnection attribute descriptor type indicates an old connectionattribute value or new value success/failure. The network adapterattribute descriptor type indicates an old network adapter attributevalue or a new network adapter attribute value success/failure.

In one exemplary embodiment of the present invention, the descriptorcontent field for the buffer send request, the buffer available request,buffer receive response, and buffer available response descriptors areall formatted with the following fields: Base 64 bits Base physicaladdress of the buffer Len 32 bits Length of the buffer in bytes Conn ID64 bits Unique connection identifier given by the network adapter ASAP 1 bit Request to DMA as soon as possible (discussed hereafter) Modify 1 bit Indicates whether this buffer has been modified (discussedhereafter)

The connection ID (Conn ID) is a value to unique identify the connectionand is provided by the offload network adapter in response to a connectrequest and as a response for connection arrivals. The connection ID 0(zero) is reserved for meaning “no connection.” This is used, forexample, to indicate that a buffer may be used for any connection (e.g.,for data on a passively accepted connection that has no ID yet). Buffersnot associated with any particular connection are called “bulk buffers.”

The ASAP and modify fields are only used for the buffer send requestdescriptor. The ASAP bit indicates a desire to have this buffer DMA'd asquickly as possible. The modify bit is for notifying the offload networkadapter whether or not this particular buffer has been changed since thelast time it was presented to the offload network adapter. This allowsthe offload network adapter to determine whether or not it already has acopy of this buffer in local memory and thus, avoid the DMA transfer ispossible.

A control descriptor describes a control buffer, which in turn containsa variable number of arbitrary-length attribute tuples. The descriptorcontent field for a control descriptor, a connect request, a terminationrequest, a listen request, a cancellation request and their respectiveresponses are all formatted with the following fields: Number  8 bitsnumber of attribute tuples in control buffer Base 64 bits Base physicaladdress of the control buffer Len 32 bits Length of the control bufferin bytes Conn ID 64 bits Unique connection identifier

The control buffer and descriptor content fields for connectionattribute requests, offload network adapter attribute requests, andtheir respective responses, are all formatted with the following fields:Get/Set  1 bit Indicates whether attribute is to be retrieved or updatedAttribute 15 bits Identifies attribute for reading/writing Length 32bits Length of attribute data Value N/A Actual attribute value, lengthis specified by prev. field

The above control descriptor is meant to be as general as possible. Dueto the volume of attributes that may be specified by the controldescriptors, they cannot all be illustrated herein. Examples of networkinterface control attributes include IP address, domain name, androuting information. Examples of per-connection control attributesinclude receive window size, Nagle algorithm setting, and SACK support.

With the present invention, the offload network adapter 730 has logic,such as in the firmware, ASICs, etc. of the offload network adapter 730,for making use of the Offload Network Adapter Programming Interface ofthe present invention. That is, the offload network adapter 730 haslogic for recognizing request descriptors, processing the requestdescriptors and corresponding data, and logic for generating responsedescriptors to be written to the output descriptor table 724. Similarly,the operating system 715, a device driver loaded by the operating system715, or the like, of the host system has logic for generating requestdescriptors to be written to the input descriptor table 722, recognizingresponse descriptors read from the output descriptor table 724, andlogic for processing the response descriptors and corresponding data.

Having given a general overview of the interaction between the hostsystem and the network adapter using the descriptors of the OffloadNetwork Adapter Programming Interface of the present invention, thefollowing description will illustrate how this interface facilitatesimproved connection establishment, memory management, and receipt ofdata using an offload network adapter.

Connection Establishment

One aspect of the present invention is the ability to offload connectionestablishment and maintenance of connection state information to theoffload network adapter. As a result of this offloading of connectionestablishment and state information maintenance, the number ofcommunications needed between the host system and the offload networkadapter may be reduced. In addition, as discussed hereafter, offloadingof these functions to the offload network adapter permits bulknotification of established connections and state information to thehost system rather than piecemeal notifications as is present in knowncomputing systems.

FIG. 8 is an exemplary diagram of the communication between host systemand an offload network adapter when establishing a communicationconnection in accordance with one exemplary embodiment of the presentinvention. As shown in FIG. 8, establishment of an outbound connectionis initiated by the receipt of a request from an application 805 by theoperating system 815, requesting that a connection be established. As aresult, the operating system 815 generates a connect request descriptorand writes it to the input descriptor table 822. The connect requestdescriptor and associated control buffer includes all of the informationrequired to establish the requested connection. For example, the controlbuffer and connect request descriptor may contain AF_INET, SOCK_STREAM,IP VERSION information and connection identifiers to reference theremote and local connections.

The offload network adapter 830 reads the connect request descriptorfrom the input descriptor table 822 and then the connectionestablishment logic 832 within the offload network adapter 830 attemptsto establish the connection based on the information received in theconnect request descriptor. Establishment of a connection based on theconnect request descriptor includes establishing a socket descriptor forthe connection, i.e. a data structure describing the socket of the hostsystem and the remote computing device, associating a connectionidentifier with the connection, and allocating a buffer in the offloadnetwork adapter 830 for the connection. That is, the offload networkadapter may perform the operations associated with conventional systemcalls connect( ), setsockopt( ), bind( ), accept( ), and the like. Onlywhen the connection is established, or an error condition is met, suchas a duration time-out condition, is the host system 810 informed of theresulting status of the connection establishment operation.

This response may be the writing of one or more response descriptors tothe output descriptor table 824. For example, a connection completiondescriptor may be generated by the offload network adapter 830 andwritten to the output descriptor table 824 to thereby inform the hostsystem 810 that the connection has been established.

Establishment of an inbound connection is performed in a slightlydifferent manner. If an application requests the ability to “listen” fora connection on a specific port, the operating system 815 may write alisten request descriptor to the input descriptor table 822. The listenrequest descriptor identifies the port on which to listen and theprotocol for which connections are to be listened for. The connectionestablishment logic 832 of the offload network adapter 820 then readsthe listen request descriptor from the input descriptor table 822 andperforms the necessary operations for establishing a connection on theappropriate incoming socket connection. This may include, for example,performing operations similar to the conventional accept( ) and bind( )system calls, however, performing them within the offload networkadapter 830. Only when the connection is established or an errorcondition is met (such as a duration time-out condition) is the hostsystem 810 informed of the resulting status of the connection. In known“offload” implementations, the host system interacts at each stage ofthe connection establishment. The present invention issues a high levelcommand to connect or listen for connections and only responds when aconnection is established or a time-out or error condition is met.

When connections are established, information about the connections ismaintained in a connection state data structure in the offload networkadapter's memory 834. This state information is used to send and receivedata over established connections. This state information may also beused to update connection state information maintained by the hostsystem 810, as discussed hereafter.

As can be seen from the above description, one of the key results ofperforming the connection establishment operations within the offloadnetwork adapter and using the Offload Network Adapter ProgrammingInterface of the present invention, communication between the hostsystem and the network adapter is minimized during establishment of aconnection. As a result, there are less messages for the host system toprocess. This is especially important when the host system is a servercomputing system with which great numbers of connections are establishedand torn down.

As mentioned above, in one embodiment of the present invention, the hostsystem may be informed of the status of a connection after theconnection is established or an error condition is encountered. Thus, asa result, a connection completion response descriptor is written to theoutput descriptor table 824 each time a connection is either establishedor the attempt to establish the connection fails. With the writing ofeach connection completion response descriptor to the output descriptortable 824, an interrupt may be generated and sent to the operatingsystem 815 to inform the host system 810 that a new response descriptoris present in the output descriptor table 824 for processing.

In order to minimize the number of times a connection completionresponse descriptor is written to the output descriptor table 824, andthus, to minimize the number of interrupts generated and sent to thehost system 810, the present invention may delay the writing of aconnection completion response descriptor to the output descriptor table824 in a number of different ways. The advantage of delaying the noticeof connection establishment status to the host is the potential foraggregation of several connections in a single notification. In thisway, a plurality of completion response descriptors for the same ordifferent connections may be “batched” together and provided to the hostsystem in one transaction between the offload network adapter and thehost system.

For example, a configurable delay value may be set based on the rate ofsocket connections being established, the rate at which connectionrequests are received, or the like. This delay value may identify anamount of aggregation of connection establishment information that maybe accumulated in an offload network adapter 830 memory beforegenerating a connection completion response descriptor that designatesthe status of each connection within the aggregate. This value may bestored in memory on the offload network adapter 830.

The delay value may be statically or dynamically determined and may takethe form of a predetermined amount of time between establishment of aconnection and notification to the host system using the connectioncompletion response descriptor, a number of connection establishmentstatus updates received, i.e. success/failure of a connectionestablishment operation, or the like. If the delay value is dynamicallydetermined, it may determined based on, for example, the rate or amountof connections received over a period of time, historical observation ofsocket connection timings, or the like. For example, if a specificsocket receive connection has bursts of 10 connection requests over 10milliseconds and then are quite for 10 seconds, it may be prudent todelay all notifications to the host system until 10 connections are madeto reduce overall notifications to the host system. A timeout feature of1 second may be used to wait for additional socket connections.

Another option for determining when to write a connection completionresponse descriptor to the output descriptor table 824 is for theoffload network adapter 830 to wait unit data arrives of the establishedconnection. In this way, the offload network adapter 830 maintainsinformation about the established connection in memory until data isreceived for processing by the host system 810. At that time, aconnection completion response descriptor may be written to the outputdescriptor table 824 informing the host system 810 of the establishmentof the connection and then a buffer receive response descriptor may bewritten to the output descriptor table 824 indicating the receipt ofdata over the established connection.

In yet another embodiment of the present invention, the notification tothe host system via the output descriptor table 824 may be delayed untila specific data pattern is received over a connection. These specificdata patterns may be, for example, a specific HTTP GET request, aspecific meta tag predetermined to indicate the end of a sequence ofdata that can be processed as a single unit, or the like.

Once this data pattern is received over an established connection, theoffload network adapter 830 may write a connection completion responsedescriptor to the output descriptor table 824 identifying all theconnections that were successfully established or failed during the timeperiod until the data pattern was received. In this way, the host system810 is not informed of establishment of the new connections until thehost system 810 has specific data to process. In other words, the hostsystem is not bothered with descriptors to process unless there issomething specific for the host system to do. That “something” isdefined by the data pattern that is being search for.

Thus, the present invention permits the aggregation of notifications ofestablished connections or failures at establishing connections, so thatthe number of notifications sent to the host system is minimized. Thislessens the amount of processing that must be performed by the hostsystem and permits the host system to use its resources to handle theapplications running on the host system.

With the present invention, since connection establishment is performedby the offload network adapter 830, the state of the establishedconnections is maintained in the memory of the offload network adapter830. However, it may be necessary for the host system 810 to have thisstate information in the event of a failover, network error conditions,or to make routing decisions. Thus, the present invention provides amechanism for migrating the state information for the establishedconnections maintained in the offload network adapter 830 to the hostsystem 810.

In one exemplary embodiment of the present invention, a connectionattribute response descriptor may be periodically generated and writtento the output descriptor table 824. This connection attribute responsedescriptor identifies the current state of each of the connections. Thehost system 810 is informed of the addition of the connection attributeresponse descriptor to the output descriptor table 824 by sending aninterrupt to the operating system 815. The host system 810 then readsthe connection attribute response descriptor and processes it such thatthe host system's connection state information is updated. Thus, thehost system 810 is provided with updated information by which the hostsystem 810 may make routing decisions and perform appropriate operationsin the event of a network error or failover.

Thus, the present invention provides mechanisms for offloadingconnection establishment to an offload network adapter such thatcommunication between the host system and the offload network adapterduring connection establishment is minimized. This may permit the hostsystem to send bulk connection establishment requests to the offloadnetwork adapter in a single connect request descriptor and then nofurther communication with the host system is necessary by the offloadnetwork adapter until certain criteria are met, e.g., a predeterminednumber of connections is established, a predetermined amount of dataarrives on a connection, a predetermined amount of time elapses, apredetermined data pattern is received, etc. Similarly, the host systemmay instruct the offload network adapter to listen for connections on aparticular port and then accept and bind those connections. As a result,the host system may send one listen request descriptor and not becommunicated with again until predetermined criteria are met with regardto establishment of connections on the port being listened to. Inaddition, the present invention provides a mechanism for storing theconnection state information in the offload network adapter and thenmigrating this state information to the host for use in routingdecisions and in the event of a network error or failover.

FIGS. 9 and 10 are flowcharts outlining operations of elements of thepresent invention in accordance with one exemplary embodiment of thepresent invention. It will be understood that each block of theseflowchart illustrations, and the other flowchart illustrations describedhereafter, and combinations of blocks in the flowchart illustrations,can be implemented by computer program instructions. These computerprogram instructions may be provided to a processor or otherprogrammable data processing apparatus to produce a machine, such thatthe instructions which execute on the processor or other programmabledata processing apparatus create means for implementing the functionsspecified in the flowchart block or blocks. These computer programinstructions may also be stored in a computer-readable memory or storagemedium that can direct a processor or other programmable data processingapparatus to function in a particular manner, such that the instructionsstored in the computer-readable memory or storage medium produce anarticle of manufacture including instruction means which implement thefunctions specified in the flowchart block or blocks.

Accordingly, blocks of the flowchart illustrations support combinationsof means for performing the specified functions, combinations of stepsfor performing the specified functions and program instruction means forperforming the specified functions. It will also be understood that eachblock of the flowchart illustrations, and combinations of blocks in theflowchart illustrations, can be implemented by special purposehardware-based computer systems which perform the specified functions orsteps, or by combinations of special purpose hardware and computerinstructions.

FIG. 9 is a flowchart outlining an exemplary operation of a host systemof the present invention when establishing a connection using an offloadnetwork adapter. As shown in FIG. 9, the operation starts by receiving aconnection establishment request from an application (step 910). Thisconnection establishment request may be, for example, a request toestablish a specific connection or a request to listen for connectionsat a particular port. A connection establishment request descriptor iswritten to an input descriptor table (step 920). This connectionestablishment request descriptor may be, for example, a connect requestdescriptor or a listen request descriptor.

The operation then waits for a response as to the completion of theconnection establishment operation from the offload network adapter(step 930). By “waiting” what is meant is that no further operations areperformed by the host system with regard to this connection until aresponse is received. Obviously the host system is performing otheroperations while this “waiting” is occurring.

A determination is made as to whether a response has been received (step940). If not, a determination is made as to whether the connectionestablishment request has timed-out (step 950). If not, the operationreturns to step 930 and continues to wait. If the connectionestablishment request has timed-out, a cancellation request descriptoris written to the input descriptor table (step 960) and the operationterminates.

If a response is received, a connection completion response descriptoris read from the output descriptor table (step 970). The connectioncompletion response descriptor is then processed by the host system(step 980) and the operation terminates.

It should be noted that the original connection establishment requestdescriptor that is written to the input descriptor table in step 920 maydesignate a plurality of connections to be established, i.e. a bulkconnection establishment request. Thus, with the present invention, thehost need only make one transaction with the input descriptor table toperform this bulk connection establishment with all of the processingnecessary for establishing these connections being offloaded to theoffload network adapter. Similarly, if the original connectionestablishment request descriptor is a “listen” request descriptor, manyconnections may be established while the offload network adapter listensto the port, however only one transaction is performed by the hostsystem to initiate the establishment of these connections.

FIG. 10 is a flowchart outlining an exemplary operation of an offloadnetwork adapter when establishing a connection in accordance with oneexemplary embodiment of the present invention. As shown in FIG. 10, theoperation starts by reading a connection establishment requestdescriptor from an input descriptor table (step 1010). Connectionestablishment operations are performed to generate socket descriptors,connection identifiers, and the like, to establish the connection(s)identified in the connection establishment request descriptor (step1020). State information regarding each of the established connectionsis stored in memory along with information identifying which connectionshave been established and which connections have failed since a previousnotification to the host system (step 1030).

A determination is made as to whether a delay criteria has been met forwriting of a connection completion response descriptor (step 1040). Asmentioned above, the delay criteria may take many different forms. Forexample, the delay criteria may be a number of connections establishedsince a last notification sent to the host system, a predeterminedamount of data arriving over one of the connections, a specified datapattern being received, a predetermined amount of time since a lastnotification to the host system, and the like.

If the delay criteria has not been met, then the operation returns tostep 1020 and continues to establish connections with state informationand connection establishment information being maintained in memory. Ifthe delay criteria has been met, a connection completion responsedescriptor is generated and written to the output descriptor tableidentifying the connections established and connections that failed tobe established since the last notification to the host system (step1050). The operation then terminates.

Thus, the present invention provides an improved mechanism forestablishing connections using an offload network adapter. This aspectof the present invention is especially well suited for bulk connectionestablishment in that the communication between the host system and theoffload network adapter is minimized so that many connections may beestablished with only a minimum amount of interaction between the hostsystem and the offload network adapter. This frees the host system toconcentrate its resources on running applications and performing otheruseful work.

Memory Management

In addition to connection establishment, the present invention improvesupon memory management in a data processing system that utilizes anoffload network adapter. The memory management according to the presentinvention permits both buffered sending and receiving of data as well aszero-copy sending and receiving of data. In addition, the presentinvention permits grouping of DMA buffers that can be shared amongspecified connections based on any number of attributes. The presentinvention further permits partial send and receive buffer operation,delaying of DMA requests so that they may be communicated to the hostsystem in bulk, and a mechanism for expedited transfer of data to thehost system.

The Offload Network Adapter Programming Interface supports conventionaluser-level application program interfaces (APIs) such as the socketinterface as well as newer APIs that allow more direct access to usermemory. The offload architecture of the present invention permits bothbuffered sending and receiving of data as well as zero-copy sending andreceiving of data. From the offload network adapter's viewpoint, thebuffered and zero-copy transmissions are handled almost identically. Themanner in which these two types of data transfers are distinguished isbased on how the host system utilizes the offload network adapter.

FIG. 11 is an exemplary diagram illustrating a memory managementmechanism in accordance with the present invention in which bufferedsending and receiving of data is utilized. It is assumed, for purposesof this description, that a connection between the host system 1110 andanother computing device (not shown) has been established through themechanisms discussed above. When a read( ) call is made referencing thisconnection, an application buffer 1130 may be established for thisconnection. The operating system 1150 may further include a pinnedkernel buffer 1140, which may be referred to as a bulk buffer thatreceives data for a variety of connections, into which data is writtenbefore sending to a network adapter or to a particular connectionbuffer, e.g., application buffer 1130. The kernel buffer 1140 is createdat connection issue time and is used when no application buffer 1130 fora connection is posted before data is sent on the connection. If anapplication buffer 1130 is posted before data is sent, the applicationbuffer may be used to receive the data. Alternatively, as discussedhereafter, both the application buffer 1130 and the kernel buffer 1140may be used in some buffered transmission embodiments.

As shown in FIG. 11, when a host system 1110 wishes to send data toanother computing device via the offload network adapter 1120, the hostsystem 1110 copies the data from an application buffer 1130 in userspace to the pinned kernel buffer 1140 of the operating system 1150 inthe operating system kernel space. This pinned kernel buffer 1140 is abulk buffer that receives data from the offload network adapter 1120 andfrom application buffers 1130 for one or more established connections.Thus, the host system 1110 may have a plurality of application buffers1130, if a plurality of connections are currently open, and data forthese connections may be transmitted/received via the pinned kernelbuffer 1140.

In this way, the data is queued for transmission by the offload networkadapter 1120. The host system 1110 may then post a buffer senddescriptor on the input descriptor table identifying the pinned kernelbuffer 1140 as having data for sending. The offload network adapter 1120may then, in response to reading the buffer send request descriptor fromthe input descriptor table, read the data from the pinned kernel buffer1140 and may transmit the data over the network (not shown) to thedestination computing device. Thereafter, the offload network adapter1120 may post a buffer available response descriptor on the outputdescriptor table indicating that the transmission of the data hascompleted. Thus, with sending of data using a buffered transmissionmechanism, the present invention copies data from the application buffer1130 to the pinned kernel buffer 1140 for transmission.

Buffered receives work in a similar manner. With a buffered receiveoperation, the offload network adapter 1120 performs a direct memoryaccess (DMA) operation to transmit the data from the offload networkadapter 1120 into the pinned kernel buffer 1140. In response to a bufferavailable request descriptor being posted by the host system 1110 on theinput descriptor table, the offload network adapter 1120 may post abuffer receive response descriptor on the output descriptor table. Thehost system 1110 may then read the buffer receive response descriptorfrom the output descriptor table and may call the read( ) socket call tocopy the data from the pinned kernel buffer 1140 to the applicationbuffer 1130 in user space.

Buffered transfers tend to be slower than optimal because of the numberof data copy operations that must be performed to transfer the data fromthe application buffer 1130 to the pinned kernel buffer 1140 or viceversa. However, buffered transfers provide two advantages. Because thedata is kept in the host kernel memory, i.e. in the pinned kernel buffer1140, memory pressure is reduced on the offload network adapter 1120since buffers need not be DMA'd to the offload network adapter 1120until they are about to be sent. In addition, fail-over is easier toaccomplish since, if the offload network adapter 1120 fails, the data isstill available in the host system's pinned kernel buffer to be sent viaanother network adapter.

The architecture of the present invention further provides a mechanismfor zero-copy transmission of data between the offload network adapterand the host system. The term “zero-copy” refers to the elimination ofmemory-to-memory copies by the host system. FIG. 12 is an exemplarydiagram illustrating a zero-copy operation in accordance with oneexemplary embodiment of the present invention. For transmitting datato/from the host system 1210, the host system 1210 may block a userapplication and pin its application buffer 1230. The host system 1210may then invoke the offload network adapter 1220 to DMA the datadirectly to/from the application buffer 1230 to the offload networkadapter 1220.

In current systems, to read from an established connection, anapplication calls the read( ) socket call with three arguments. Thefirst argument specifies the socket descriptor to use, the secondargument specifies the address of the application buffer 1230, and thethird argument specifies the length of the buffer. A read extracts databytes that have arrived at that socket and copies them to the user'sbuffer area, e.g. application buffer 1230. If less data has arrived thanfits into the user's buffer area, read( ) extracts all the data andreturns the number of bytes it found.

With zero-copy in the system according to the present invention, thecreation of an application buffer 1230, i.e. a DMA buffer, causes adescriptor communication packet to be generated and sent from the hostsystem 1210 to the offload network adapter 1220 e.g., a buffer availablerequest descriptor communication packet may be generated and posted tothe input descriptor table. The descriptor describes the applicationbuffer 1230, its attributes, and associates the application buffer 1230with connection information for the established connection. When theapplication buffer is available to the offload network adapter 1220, andwhen a read( ) socket call is performed, a DMA operation is performed totransfer the data from the offload network adapter 1220 to theapplication buffer 1230. A response descriptor from the offload networkadapter 1220 is then created describing the DMA data attributes requiredfor the read( ) call completion notification, e.g., a buffer availableresponse descriptor may be generated and posted to the host system'sinput descriptor table.

It should be noted that the offload network adapter 1220 maintainsinformation for each open connection in memory for use in performing itsfunctions. This information may include identification of theapplication buffers associated with the open connections as well asother connection specific information. This information is then usedwhen the offload network adapter 1220 needs to communicate data betweenitself and the applications on the host system 1210.

Thus, with the present invention, the offload network adapter may senddata directly to an application buffer in user space using a directmemory access operation. In so doing, the copying of data from a pinnedkernel buffer to the application buffer is avoided. Of course, thepresent invention may operate in either mode, i.e. buffered send/receiveor zero-copy send/receive, or may use both modes interchangeably or atapproximately the same time. That is, some data may be transferredbetween the host system and the offload network adapter using bufferedsend/receive and other data may be transferred using zero-copysend/receive. For example, the zero-copy send/receive may be usedwhenever the application read( ) call preceeds the reception ofrespective data on a socket. In this way, an application buffer will bepre-posted for receiving data on the established connection. If theread( ) call does not preceed the reception of data on the socket, thenthe buffered send/receive may be used.

In a preferred embodiment, zero copy send/receive is a preferred mannerof sending/receiving data to/from the host system. However, situationsmay arise in which zero copy send/receive is not possible. For example,if an application buffer's available memory is going to be exceeded orif an application buffer is not available, the offload network adaptermay not be able to send data directly to the application buffer using adirect memory access operation. As a result, buffered sending of thedata to a shared buffer may be required.

The offload network adapter of the present invention has the ability togroup application buffers that can be shared among specified connectionsbased on any number of attributes. In a preferred embodiment, thegrouping of application buffers is based on the connection port number.That is, application buffers that all use the same port number may shareapplication buffers. For example, in web serving scenarios, there may bemultiple connections per port. An example is the TCP/IP port 80 of a webserver. There may be thousands of client HTTP connections requestinginformation over port 80. The buffers allocated to port 80 may begrouped, i.e. a pool of allocated buffers may be established, in orderto handle these information requests coming in on port 80.

Sharing the application buffers on send operations allows reuse of datafor host system based broadcast or multicast type connections. That is,the data need only be written to the shared application buffers once,but may be transmitted over a plurality of connections that share thoseapplication buffers. Sharing the application buffers for received dataallows for more efficient use of memory for active connections that havelow bandwidth requirements or transient bursts of traffic. That is,multiple connections may share a smaller shared application buffer thanhaving to have their own dedicated individual application buffer inwhich much of the memory for the buffer may go unused with low bandwidthor transient burst connections. In addition, sharing application buffersallows separate applications and processes to share the data that isreceived.

FIG. 13 is an exemplary diagram illustrating a shared buffer arrangementaccording to one exemplary embodiment of the present invention. In thedepicted example, three processes X, Y and Z are currently running onhost system 1310. Five connections A, B, C, D and E have beenestablished and corresponding application buffers 1350-1370 have beenestablished in host system 1310 memory for these connections.Application buffers 1350 and 1360 are individual application buffersinto which data may be sent directly using a DMA operation.Alternatively, data may be copied into these application buffers1350-1360 using pinned kernel buffer 1330 as part of a bufferedsend/receive operation, as discussed above.

Application buffers 1370 are shared application buffers that are sharedbetween connections C, D and E. For example, connections C, D and E mayall use the same port number for their socket connections, may be lowbandwidth connections, and thus, may share buffer space. Alternatively,connections C, D and E may be part of a multicast or broadcast groupthat is to share the buffers 1370 for multicasting or broadcasting ofdata.

As shown in FIG. 13, when a buffered send/receive transfer of data isutilized, data is first sent, using a DMA operation, from the offloadnetwork adapter 1320 to the pinned kernel buffer 1330 in the operatingsystem 1340 of the host system 1310. In response to the host system 1310posting of a buffer available request descriptor in the output buffertable, the offload network adapter 1320 posts a buffer receive responsedescriptor in the input descriptor table. The host system 1310 may thencall read( ) to copy the data from the pinned kernel buffer 1330 to theshared application buffers 1370 for connections C, D and E. From theseshared application buffers 1370, data may be read in by one or moreprocesses that share the shared application buffers 1370. For example,process Z may read in data from the shared buffers 1370. Any processthat listens for data on connections C, D or E may perform theseoperations to read-in data on its connection from the pinned kernelbuffer 1330 to the shared buffers 1370.

Alternatively, as with the individual application buffers 1350 and 1360,data for connections C, D and E may be DMA'ed into the shared buffers1370 directly from the offload network adapter 1320. In this way, a zerocopy implementation of the present invention may make use of sharedbuffers 1370 to hold data for sending/receiving from a plurality ofconnections.

One instance in which the shared buffers 1370 is especially useful iswhen the offload network adapter 1320 needs to DMA data to the hostsystem 1310 memory before the application has established an applicationbuffer in which to receive the data. For example, this may occur whendata continues to be received on the offload network adapter 1320 beyonda predetermined threshold and the offload network adapter could be indanger of running out of memory. Given that such a scenario may exist,an intermediate copy of the data into the shared system buffers 1370 inhost memory would aid in alleviating this situation. That is, data maybe copied into a shared buffer 1370 for all of the open connectionsrather than a dedicated connection application buffer, such as buffer1350.

Thus, in addition to the advantages associated with zero copy datatransfers between the host system and the offload network adapter, thepresent invention also provides a mechanism by which connections mayshare buffers in order to minimize the amount of host system memory usedby connection buffers, provide a mechanism for handling data in theevent of the offload network adapter memory overflowing, and to avoidunused host system memory allocated to dedicated connection buffers.

In addition to the above memory management mechanisms, the presentinvention also provides for partial receive and send buffers forestablished connections. The “partial receive and send buffers”functionality of the present invention refers to the ability of thepresent invention to append receiving data to a buffer that has alreadyreceived/sent data for the application. The buffer is reused for theapplication data transfer rather than two separate buffers beingallocated.

FIG. 14 illustrates the manner by which partial receive/send buffersoperate in accordance with one exemplary embodiment of the presentinvention. With partial receive/send buffers, the host system 1410informs the offload network adapter 1420 of the application buffer 1430being allocated for a particular connection. For example, a bufferavailable request descriptor may be posted to the input descriptortable. In this way, the host system 1410 hands over ownership of theapplication buffer 1430 to the offload network adapter 1420.

The offload network adapter 1420 then receives data over the connectionand DMA's the data to the application buffer 1430 on the host system1410. The offload network adapter 1420 may then post a buffer receiveresponse descriptor in the output descriptor table. In the depictedexample, the data that is DMA'ed to the application buffer 1430 is onlyenough to partially fill the application buffer 1430.

Upon informing the host system 1410 of the data's arrival in theapplication buffer 1430, the network interface hands control of this“partial” application buffer 1430 over to the host system 1410. Anyremaining part of the initial buffer is still under control of theoffload network adapter 1420. The semantics of the Read( ) call requiresthe addition of an “Byte Offset” value in a response. The application inthe host system 1410 will know full control of the application buffer1430 is returned to the host system 1410 when the Offset+Length of datareturned equals the total length of the original application buffer1430. If the Offset+Length of the data does not equal the total lengthof the original application buffer 1430, then the offload networkadapter 1420 still maintains partial control of the buffer.Alternatively, an additional field can be provided that indicates afinal transfer of data for the application buffer 1430. If this is thefinal transfer of data for the application buffer 1430, then control hasbeen returned to the host system 1410 and the offload network adapter1430 does not maintain partial control of the application buffer 1430.

Thereafter, if additional data is received over the connection, theoffload network adapter 1420 may then DMA this additional data into thesame application buffer 1430 on the host system 1410 such that the datais appended in the application buffer 1430. The host system 1410 is theninformed by the offload network adapter 1420, such as through theposting of another buffer receive response descriptor in the outputdescriptor table, that additional data has arrived for the connection.

With such a mechanism as described above, fragmentation may be an issueif network packet sizes do no equal host memory buffer sizes. However,in the case where a large contiguous virtual buffer is provided forapplication use, buffer fragments may be used in order to preservevirtual contiguous space preferences. This saves the application fromthe added chore of concatenating buffers on virtual memory.

Consider, for example, an application Read( ) call that provides a 4megabyte application buffer for data to be transferred to. This could bein anticipation of receiving a large data file or multimedia stream fordisplay, for example. The offload network adapter can return 1500 byteportions of this data directly to the application buffer as they arereceived from the network. This arrangement allows this data to bereceived in contiguous virtual (application) space saving additionalcomplexity of reassembly of the data on the application side.

On the other hand, the offload network adapter 1420 may elect to allowfragmentation when the application buffers are not part of a largecontiguous virtual buffer to optimize placement of received data.Permitting fragmentation may help to reduce the number of buffers handedfrom the offload network adapter 1430 to the host system 1410 and viceversa. Thus, in addition to permitting zero copy transfers of data,buffered transfers of data, and shared buffers, the present inventionfurther provides a mechanism for reuse of partially filled buffers so asto minimize the number of buffers allocated for use by connections.

As described above, the manner by which the offload network adaptercommunicates and transfers data between itself and the host system isthrough DMA operations. As with the establishment of connections, theoffload network adapter may delay these DMA operations when transferringdata to/from the offload network adapter and the host system so thatbulk transfers of data may be accomplished. That is, the offload networkadapter does not necessarily initiate DMA requests as soon as the hostsystem requests a data transfer. When the offload network adapter deemsit appropriate, the offload network adapter may decide when DMAoperations are to be initiated on transmitted data.

For example, the offload network adapter may delay DMA operations fortransferring data over a connection if it already has sufficient data inthe memory of the offload network adapter to send over that connection.The offload network adapter may determine what constitutes a“sufficient” amount of data based on various criteria, for example, acurrent estimate of a product of the bandwidth and the delay, acongestion window, memory available on the offload network adapter, andthe like. The offload network adapter may also make decisions based onother possible criteria such as fair queuing, quality of serviceassociated with applications associated with the connections,differentiation of services, and the like.

For example, consider the case where an application Read( ) callprovides a 4 megabyte buffer for data to be transferred to. The offloadnetwork adapter can return 1500 byte portions of this data directly tothe buffer as they are received from the network. The offload networkadapter can recognize that the application provided a very large bufferin anticipation of a bulk data transfer and may then batch multiple 1500byte packets received from the network in anticipation of receivingadditional packets. The number of 1500 byte packets in a bulk transferwould be a function of the characteristics of the connection between thehost system and the offload network adapter. As an example, newertechnologies such as PCI-Express can move larger blocks of data, say64K, more efficiently that earlier PCI 2.1 bus interconnects.

As previously mentioned, when data is placed in an application bufferfor sending, a buffer send request descriptor may be posted to the inputdescriptor table. This buffer send request descriptor may include an assoon as possible (ASAP) bit that indicates whether the sending of thedata is to be expedited or not. The setting of the ASAP bit may furtherbe a criteria utilized by the offload network adapter in determining ifand by how much a DMA operation should be delayed. Of course, wheneverpossible, the offload network adapter should attempt to honor the hostsystem's request for expedited transmission of data through the settingof this ASAP bit.

DMA operations tend to have a fixed setup cost as well as a per-bytetransfer cost, in terms of processor cycles, required memory resources,and the like. In order to make better use of the I/O bus and reducesetup costs relative to per-byte costs, the offload network adapter mayaggregate DMA transfers by recognizing that two requests for DMAtransfers are for adjacent regions of physical memory. The host systemmay try to encourage this process by, for example, allocating largeapplication buffers per connection, filling in subsets of theapplication buffers incrementally, and generating requests for theadjacent subsets of memory accordingly. The offload network adapter mayrecognize the subsets as adjacent and aggregate the DMA transfers.

As an example, the descriptor queue contains detailed information ofaddress and length for DMA transfers. An inspection of adjacentdescriptors prior to performing a DMA operation may show that thefollowing DMA request is simply a continuation of the current request,i.e. is directed to an adjacent portion of memory. In this case both DMAtransfers can be satisfied with a single, combined request thatreferences both DMA operations that need to be made. This reduces theoverhead of handling DMA transfer requests between the host system andthe offload network adapter by providing bulk notifications of these DMAtransfers.

The present invention may “store up” DMA data transfers until asufficient number of DMA data transfers is present. The criteria fordetermining “sufficient” may vary as discussed above. Once a sufficientnumber of DMA data transfers are ready for execution, the presentinvention uses a priority mechanism for determining the order by whichthese DMA data transfers are to occur. Thus, in one exemplary embodimentof the present invention, DMA operations are reordered by the offloadnetwork adapter based on a priority mechanism so that preference may begiven to starved connections and to high priority connections.

FIG. 15 illustrates an exemplary DMA transfer order decision makingprocess in accordance with one exemplary embodiment of the presentinvention. As shown in FIG. 15, three connections have been established,connections A, B and C. These connections have been given a semanticpriority ordering of A, B and C with A being the highest or preferredconnection. This priority ordering may be determined for example, basedon priorities assigned to applications or application connections by auser or the host system. As mentioned previously, the offload networkadapter may store information regarding established connections. Thispriority information may be stored as part of the connection informationin the offload network adapter and may be replicated, along with therest of the connection information, on the host system. In this way, thepriorty information is made available to both the offload networkadapter and the host system for use in determining ordering of DMAoperations.

At the depicted time, all connections have sufficient data on theoffload network adapter 1520 to send over the connections A, B and C.The determination that needs to be made is to the order in which datashould be DMA'ed from the application buffers 1530, 1540 and 1550, tothe offload network adapter buffers 1560, 1570 and 1580 fortransmission.

With the present invention, bulk transfers of data are facilitated bystoring groups of descriptors in the input descriptor table 1590describing send operations and addresses for which the applicationbuffers 1530-1550 that are available to send data. The offload networkadapter reorders the list of descriptors in the input descriptor table1590 based on the designated priorities of the connections.

The reordering of the list of descriptors, in one exemplary embodiment,is initially performed based on currently data starved connections. Thatis, if a connection is data starved, i.e. data has not been transmittedover the connection for a predetermined period of time, then descriptorsassociated with data for transmission over such a connection is orderedfirst in the list of descriptors. Thereafter, descriptors are reorderedbased on the priorities associated with the connections.

Thus, in accordance with the depicted example, the input descriptortable entries 1590, i.e. the buffer send request descriptors forconnections A, B and C, will be read and reordered by the offloadnetwork adapter 1520 so that the reordered list of descriptors has thefollowing order: A1, A2, A3, B1, B2, B3, C1, C2, C3. The data will thenbe read in from the application buffers 1530-1550 in this order andstored in the offload network adapter buffers 1560-1580 such thatpriority is given to connection A.

Thus, the present invention further provides a mechanism for bulktransfers of data using application buffers, buffer send requestdescriptors, an input descriptor table, and DMA operations between thehost system and the offload network adapter. In this way, DMA operationsmay be delayed so that they may be performed in bulk rather thanpiecemeal interruptions of the applications running on the host system.

FIG. 16 is a flowchart outlining an exemplary operation when sendingdata using a host system and offload network adapter in accordance withaspects of one exemplary embodiment of the present invention. As shownin FIG. 16, the operation starts with a request to transmit data beingsent to the operating system by an application (step 1610). The data isthen copied from an application buffer to a pinned kernel buffer (step1620). A buffer send descriptor is then posted to the input descriptortable (step 1630).

The offload network adapter then, through a DMA operation, reads thenext entry in the input descriptor table (step 1640). It is assumed forpurposes of this description that the next entry is the buffer senddescriptor. The input descriptor table is stored in a bulk transfer list(step 1650) and a determination is made as to whether a delay criteriahas been met (step 1660). If not, the operation returns to step 1640 toread the next entry in the input descriptor table. However, if the delaycriteria has been met, the bulk transfer list is reorganized based on adetermination as to whether any of the connections have been starved andconnection priority (step 1670).

As mentioned above, as part of this determination, it may be determinedwhether the buffer send descriptor indicates that an ASAP bit has beenset. If so, the delay criteria is determined to have been met and thetransmission of the data is performed immediately, if possible.

Thereafter, the data is read from the pinned kernel buffer, via a DMAoperation, and is transmitted by the offload network adapter in theorder determined from the reorganization of the bulk transfer list (step1680). A buffer available response descriptor may then be posted to theoutput descriptor table which is then read in by the host system toacknowledge sending of the data by the offload network adapter (step1690). The operation then terminates.

FIG. 17 is a flowchart outlining an exemplary operation when performinga zero copy transfer of data between a host system and an offloadnetwork adapter in accordance with aspects of one exemplary embodimentof the present invention. As shown in FIG. 17, the operation starts byreceiving data in the offload network adapter over an establishedconnection (step 1710). The offload network adapter then posts a bufferreceive response descriptor to the output descriptor table (step 1720).The host system reads the next entry in the output descriptor table(step 1730). It is assumed for purposes of this description that thenext entry in the output descriptor table is the buffer receive responsedescriptor. The output descriptor table entry may then be stored in abulk transfer list (step 1740).

A determination is made as to whether a delay criteria has been met(step 1750). If not, the operation returns to step 1730. If the delaycriteria has been met, then the bulk transfer list is reordered based onwhether or not a connection has been starved and connection priorities(step 1760). The data is then transferred directly to the applicationbuffers associated with each connection for which there is data, in theorder determined from the reordering of the bulk transfer list, usingDMA operations (step 1770). The host system may then post a bufferavailable response descriptor to the input descriptor table for each DMAoperation that is completed (step 1780). The operation then terminates.

It should be appreciated that the application buffers to which data issent using DMA operations may include one or more shared applicationbuffers. Thus, data received for various connections that share the oneor more shared application buffers may be DMA'ed into the sharedapplication buffers and the applications may retrieve the data from theshared application buffers. This is true for the data send operationdescribed in FIG. 16 as well, i.e. the application buffer from which thedata is sent may be a shared application buffer.

Thus, the present invention provides mechanisms for sharing applicationbuffers, delaying communication between the host system and the offloadnetwork adapter such that bulk transfers of data may be achieved, andzero copy transfers of data between the host system and the offloadnetwork adapter. In addition, the present invention provides a mechanismfor partial buffer data transfers such that data may be transferred tothe same application buffer that already has had data transmitted to it.

Handling Received Data

In addition to connection establishment and memory management, thepresent invention improves upon the handling of received data in a dataprocessing system that utilizes an offload network adapter. As discussedabove, the offload network adapter of the present invention may includelogic that permits the offload network adapter to delay notification ofdata reception to the host system in different ways. The advantage ofdelaying the notice of data packet reception to the host system is thepotential for aggregation of several data packets, which can arriveimmediately after the first one, for example, in a single notification.Given a stream with continuous data packet arrival, a value may be setfor notification delay and this value may be configurable for the hostsystem per communication socket.

The delay value may be set statically or dynamically. For example, thedelay value may be set based on the rate or amount of data received overa period of time through historical observation of data received in thesocket connection. An example may be that if a specific receiveconnection operates in bursts of 10 packets of data over 10 millisecondsthat then are quite for 10 seconds, it may be prudent to delay allnotifications of packet arrivals for 10 milliseconds to reduce overallnotifications to the host system.

Alternatively, the rate at which the host system is posting applicationbuffers to connections may be monitored and used as a basis fordynamically setting this delay value. If the host posts applicationbuffers at a specific rate, e.g., once every 10 milliseconds, it wouldmake sense to delay data arrival notifications by 10 milliseconds toinsure a buffer is available for zero copy transfer of data from theoffload network adapter to the host system.

As a further alternative, the rate at which the host system posts newbuffers for a connection after a data arrival notification has been sentto the host system may be monitored and used as a basis for setting thedelay value. This indicates the rate at which the host system consumesdata from a particular connection. For example, it may take 10milliseconds for the host system to consume data within a buffer and topost the buffer to the offload network adapter for use. Thus, anotification delay of 10 milliseconds might be prudent to insure thereplacement of a data buffer for zero copy transfers of data between theoffload network adapter and the host system.

In yet another alternative embodiment, the amount of data may be usedrather than a time metric for buffer reception posting delay. In thiscase, the delay value is set to wait for a certain amount of data to bereceived before notifying the host system of reception of the datapackets. The amount of data can be set statically by the host system asan option in the set-up of the connection or dynamically by the offloadnetwork adapter based on historical observation. Other methods andmechanisms for determining the setting of a delay value may be usedwithout departing from the spirit and scope of the present invention.

Regardless of which alternative embodiment is chosen for determining theamount of the delay, a maximum delay value may be maintained in theoffload network adapter for identifying a maximum delay between a firstdata arrival and eventual notification of the data arrival to the hostsystem. This insures that there are no excessive delays between arrivalof data and notification of the arrival of data to the host system. Thedelay value, maximum delay value, and the other information necessaryfor determining the delay value may be stored in memory on the offloadnetwork adapter for use in setting the delay value and for determininghow long to delay notifications to the host system from the offloadnetwork adapter.

In the previous descriptions of the operation of the present invention,the delay value determined according to one or more of the alternativesdiscussed above, and the maximum delay value, are utilized indetermining if delay criteria are met. For example, when determining ifa delay criteria is met, a comparison of the timing delay from thereceipt of a first data packet may be compared to the delay value. Oncethe timing delay meets or exceeds the delay value, a bulk transfer ofdata packets may be made from the offload network adapter to the hostsystem, or vice versa. Similarly, if the delay value is presented interms of an amount of data, the amount of data received over connectionsfrom a first data packet having been received may be compared to thedelay value to determine if the amount of data meets or exceeds theamount of data set in the delay value. If so, a bulk transfer of thedata from the offload network adapter to the host system, or vice versa,may be initiated through a bulk data receive notification being sent tothe host system or offload network adapter, e.g., a buffer receiveresponse descriptor being posted to either the input or outputdescriptor tables.

In current non-intelligent host-network adapter systems, all data passesthrough a pool of non-connection specific application buffers in thehost's operating system layer. Given that zero copy transfers of data toconnection specific application buffers are possible using themechanisms of the present invention, the present invention provides adecision process for the case when no connection specific applicationbuffer or shared application buffer has been currently posted by theapplication to receive data. By default, if a connection specificapplication buffer or shared application buffer has not been allocatedto the connection, the decision process of the present inventiontransfers the data from the offload network adapter to the applicationusing a buffer from a pool of non-connection specific applicationbuffers.

However, with the present invention, a host system providedconfiguration parameter may be provided such that if no connectionspecific buffer exists, then the offload network adapter may wait untila connection specific application buffer is allocated rather than usingthe non-connection specific application buffers. This parameter may bestored in the memory of the offload network adapter and may be used tooverride the default behavior of the system so that the offload networkadapter waits until a connection specific application buffer isallocated for the connection before data is DMA'ed to the host system.This waiting may be done until either the connection specificapplication buffer is allocated or a maximum wait time is met orexceeded. If the maximum wait time is met or exceeded, the data storedin the offload network adapter for the connection may be DMA'ed to anon-connection specific application buffer.

Rather than setting a predefined host provided configuration parameterto override the default behavior of using the non-connection specificapplication buffers, the offload network adapter itself may be providedwith logic that permits it to determine, based on historical data of thehost system supplying connection specific application buffers, whetherto wait for a connection specific application buffer, how long to waitfor a connection specific buffer, or to not wait for a connectionspecific application buffer.

For example, a host system may have provided connection specificapplication buffers for zero copy operations 100% of the time in thetime frame observed in the historical data. That is, in the last xnumber of data transfers, a connection specific application buffer wasutilized 100% of the time to facilitate these data transfers. As aresult, the above operation of waiting for a connection specificapplication buffer may be performed.

However, if the historical data indicates that the data transfers werenot performed 100% of the time using a connection specific applicationbuffer, a determination is made as to whether the percentage of times aconnection specific application buffer was utilized is less than apredetermined threshold amount. If so, then the offload network adaptermay not wait for a connection specific application buffer to beallocated and may make use of the non-connection specific applicationbuffers. Alternatively, the amount of time that the offload networkadapter waits for a connection specific application buffer may bereduced based on whether the percentage value falls below thepredetermined threshold. As data transfers continue, the historical datamaintained within the offload network adapter may be a time window thatmoves along with each data transfer. Thus, as more data transfers areperformed using connection specific application buffers, the percentagevalue may increase to above the predetermined threshold and the systemmay return to waiting for connection specific application buffers to beallocated or to the original wait time for a connection specificapplication buffer.

In another aspect of an exemplary embodiment of the present invention,if a non-connection specific application buffer must be selected fromthe pool for use in DMA'ing data from the offload network adapter to thehost system, the present invention provides logic within the offloadnetwork adapter for selecting a non-connection specific applicationbuffer to which to send the data. This logic looks at each of thecharacteristics of the various non-connection specific applicationbuffers in the buffer pool and selects the one that provides a bestmatch for the data that is to be transferred from the offload networkadapter to the host system. The information about the buffers may beobtained from the connection information maintained in the host systemand/or the offload network adapter.

For example, when the offload network adapter determines that it mustuse a non-connection specific application buffer from the buffer pool,the offload network adapter reads in characteristic information for thebuffers in the pool from the host system. This characteristicinformation may be, for example, the size of the buffer, speed of thebuffer, placement of the buffer in the host processor architecture, etc.Based on these characteristics, the offload network adapter selects abuffer from the pool that is a best candidate for use in transferringthe data from the offload network adapter to the host system.

Taking, as an example, buffer size as the characteristic to which theselection process is keyed, there may be several non-connection specificapplication buffers available in the buffer pool having different sizes.Given that a certain amount of data is to be transferred to the hostsystem, the offload network adapter would select a non-connectionspecific application buffer from the buffer pool that has sufficientsize to wholly contain the data rather than spreading the data over aplurality of buffers. The other characteristics mentioned above may beused in a similar manner to determine the best buffer to use for theparticular data transfer.

FIG. 18 is a flowchart outlining an exemplary operation for determiningan application buffer to send data to in accordance with aspects of oneexemplary embodiment of the present invention. As shown in FIG. 18, theoperation starts by receiving data in the offload network adapter fortransfer to the host system (step 1810). A determination is then made asto whether a connection specific application buffer is allocated for theconnection(s) to which the received data is directed (step 1820). If so,then the data is transmitted to the allocated connection specificapplication buffer(s) using DMA operations (step 1830) and the operationterminates.

If a connection specific application buffer is not allocated for aconnection to which data is directed (step 1820), a determination ismade as to whether a wait parameter has been set (step 1840). If so, adetermination is made as to whether a wait threshold has exceeded (step1850). If not, the operation loops back to step 1820 and continues toloop until the wait threshold is exceeded or until a connection specificapplication buffer is allocated.

If the wait threshold has been exceeded (step 1850) or a wait parameterhas not been set (step 1840), characteristic information for thenon-connection specific application buffers in the buffer pool isretrieved from the host system (step 1860). A non-connection specificapplication buffer is then selected from this pool based on theretrieved characteristic information (step 1870). The data is thentransferred directly into the selected non-connection specificapplication buffer using a DMA operation (step 1880) and the operationterminates.

An additional design may permit direct data placement into the L3 cachearchitecture as an option to DMA placement. That is, data may be pushedinto the L3 cache using a cache injection mechanism and a virtualaddress provided by the host system. Instead of or in addition to DMAplacement of the data in application buffers, data that needs to beprocessed quickly may be provided to the L3 cache for immediateprocessing.

There are many ways in which it can be decided whether specific datashould be injected into the L3 cache or not. For example, thedetermination of which data should be injected into the L3 cache may bebased on explicit configuration information established by host systemper connection. Altneratively, this determination may be based onmonitoring how much data has already been injected into the L3 cacherecently to determine if a cache overflow situation is probable. Othermechanisms thatdeter whether injection of the data into the L3 cachewould obtain any benefit or cause cache overflow may also be used.

As mentioned above, this type of memory management mechanism might bepreferable for certain traffic that requires immediate CPU attentionsuch as web request/response traffic. Other types of data, such as ISCSIdata, that is prefetched for the file system might be better off as aDMA since it may not be required for some time. This parameter can beidentified based on the origin of the request for network reads orconfiguration parameters.

It should be appreciated that although the alternative embodimentdescribed above makes reference to injection of data into the L3 cache,this embodiment is not limited to use with an L3 cache. L3 is preferredin the exemplary embodiment since it has a physical address mapping inmany known architectures. This reduces the complexity in the design ofmoving the data directly from the Input/Output device. However, inemerging network adapters, such as the RDMA network adapters of systemarea networks such as InfiniBand, a user address may be provided thatallows data injection into a virtual addressable L3 cache as well as anyother cache in the memory hierarchy. Additionally, an addresstranslation can be made from real to virtual, thereby providing thenecessary address for any type of cache. Thus, the mechanisms of theexemplary alternative embodiment may be applied to any level cachedepending on the particular architecture of the system.

In a further aspect of the present invention, the offload networkadapter may contain logic for reassembling separate but in-ordersegments of data buffers. The descriptors in the being generated by theoffload network adapter may be examined, prior to posting thedescriptors to the output descriptor table, to see if the data to bemoved is to a consecutive physical address space. If multipledescriptors are generated that identify consecutive physical addressesin memory, then rather than posting a plurality of descriptors to theoutput descriptor table, the data to be transferred may be combined inan offload network adapter and a single combined descriptor may be usedto identify each data transfer. For example, TCP/IP segments may bereassembled into appropriately sized buffers (e.g. 4 K page aligneddata) and communicated in bulk to the host system. This provides foreasier data buffer management on the host system and greater efficiency.This can potentially reduce the amount of buffers required to servicethese multiple connections.

In a further aspect of an exemplary embodiment of the present invention,the offload network adapter is provided with logic for examining datawithin a received packet but not consume the data. A receive call mayspecify a “peek” option which may provide a copy of a portion, e.g., theheader, of the data packet received to the host application. This mayallow the host application to examine the header data and make decisionson how the payload can be consumed. As an example, an application may beexpecting to receive different types of data tagged by a headeridentifier. This is particular useful in cases where the header and thepayload data is of variable length. The program can simply “peek” on themaximum length of any header to examine header information. Peeking atthe header may allow the program to determine which application bufferto send the payload of the data packet to based on the intended programstream.

Thus, when the “peek” option is set for a connection in the offloadnetwork adapter, a copy of the header of a received data packet isprovided to the host application when then determines what type of datais being received and which socket, i.e. connection, to transmit thedata packet payload over. For example, an application may have separateconnections for video data and audio data. From the header, theapplication may be able to determine a type of data in the payload of adata packet. If the data is video data, the peek operation permits thehost application to designate that the data packet payload should beDMA'd to the application buffer associated with a first connection. Ifthe data is audio data, the peek operation permits the host applicationto designate that the data packet payload should be DMA'd to theapplication buffer associated with a second connection.

To compliment this peek operation, an option is provided to read datawith an offset. In this way, the payload of the data packet may beeasily separated from the header which was peeked upon. That is, sincethe host application knows the actual size of the header, an offset maybe generated and stored for use in skipping over the header whenprocessing the data packet. This is most useful when the header issmaller than the number of bytes specified in the peek operation.

It is important to note that while the present invention has beendescribed in the context of a fully functioning data processing system,those of ordinary skill in the art will appreciate that the processes ofthe present invention are capable of being distributed in the form of acomputer readable medium of instructions and a variety of forms and thatthe present invention applies equally regardless of the particular typeof signal bearing media actually used to carry out the distribution.Examples of computer readable media include recordable-type media, suchas a floppy disk, a hard disk drive, a RAM, CD-ROMs, DVD-ROMs, andtransmission-type media, such as digital and analog communicationslinks, wired or wireless communications links using transmission forms,such as, for example, radio frequency and light wave transmissions. Thecomputer readable media may take the form of coded formats that aredecoded for actual use in a particular data processing system.

The description of the present invention has been presented for purposesof illustration and description, and is not intended to be exhaustive orlimited to the invention in the form disclosed. Many modifications andvariations will be apparent to those of ordinary skill in the art. Theembodiment was chosen and described in order to best explain theprinciples of the invention, the practical application, and to enableothers of ordinary skill in the art to understand the invention forvarious embodiments with various modifications as are suited to theparticular use contemplated. What is claimed is:

1. A method of establishing a data communication connection between dataprocessing systems, comprising: receiving, in a host system of a firstdata processing system, a request for establishing a connection with asecond data processing system; forwarding the request to an offloadnetwork adapter associated with the first data processing system;establishing, within the offload network adapter, the connection withthe second data processing system; and informing the host system of theestablished connection after the connection is established within theoffload network adapter.
 2. The method of claim 1, wherein forwardingthe request to an offload network adapter includes: generating aconnection establishment request descriptor based on the receivedrequest; and writing the connection establishment request descriptor toa reserved portion of input/output addressable memory in the hostsystem.
 3. The method of claim 1, wherein establishing the connectionwith the second data processing system includes: generating, within theoffload network adapter, a data structure describing the connection; andstoring state information for the connection in the data structure. 4.The method of claim 1, wherein informing the host system of theestablished connection includes: generating a connection completionresponse descriptor; and writing the connection completion responsedescriptor to a reserved portion of input/output accessible memory ofthe host system.
 5. The method of claim 1, wherein the request is arequest to establish a plurality of connections, and wherein forwardingthe request to an offload network adapter associated with the first dataprocessing system includes: generating a connect request descriptoridentifying each of the connections in the plurality of connections thatare to be established; and writing the connect request descriptor to areserved portion of input/output accessible memory of the host system.6. The method of claim 1, wherein informing the host system of theestablished connection only after the connection is established withinthe offload network adapter includes: determining if a delay criteriahas been met; and writing a connection completion response descriptor toa reserved portion of input/output accessible memory of the host systemif the delay criteria has been met.
 7. The method of claim 6, whereinthe delay criteria is at least one of a predetermined number ofconnections being established since a last connection complete responsedescriptor was written to the reserved portion of input/outputaccessible memory, a predetermined amount of data arriving over aconnection, a predetermined data pattern being detected in receiveddata, a predetermined amount of time since a last connection completeresponse descriptor was written to the reserved portion of input/outputaccessible memory.
 8. The method of claim 1, further comprising:migrating state information for the connection from the offload networkadapter to the host system.
 9. The method of claim 8, wherein migratingstate information for the connection from the offload network adapter tothe host system includes: generating a connection attribute responsedescriptor identifying the sate of the connection; and writing theconnection attribute response descriptor to a reserved portion ofinput/output accessible memory of the host system.
 10. The method ofclaim 1, wherein the request for establishing a connection with a seconddata processing system is a listen request, and wherein establishing theconnection with the second data processing system includes identifyingconnection requests received for a designated port number.
 11. Acomputer program product in a computer readable medium for establishinga data communication connection between data processing systems,comprising: first instructions for receiving, in a host system of afirst data processing system, a request for establishing a connectionwith a second data processing system; second instructions for forwardingthe request to an offload network adapter associated with the first dataprocessing system; third instructions for establishing, within theoffload network adapter, the connection with the second data processingsystem; and fourth instructions for informing the host system of theestablished connection after the connection is established within theoffload network adapter.
 12. The computer program product of claim 11,wherein the second instructions for forwarding the request to an offloadnetwork adapter include: instructions for generating a connectionestablishment request descriptor based on the received request; andinstructions for writing the connection establishment request descriptorto a reserved portion of input/output addressable memory in the hostsystem.
 13. The computer program product of claim 11, wherein the thirdinstructions for establishing the connection with the second dataprocessing system include: instructions for generating, within theoffload network adapter, a data structure describing the connection; andinstructions for storing state information for the connection in thedata structure.
 14. The computer program product of claim 11, whereinthe fourth instructions for informing the host system of the establishedconnection include: instructions for generating a connection completionresponse descriptor; and instructions for writing the connectioncompletion response descriptor to a reserved portion of input/outputaccessible memory of the host system.
 15. The computer program productof claim 11, wherein the request is a request to establish a pluralityof connections, and wherein the second instructions for forwarding therequest to an offload network adapter associated with the first dataprocessing system include: instructions for generating a connect requestdescriptor identifying each of the connections in the plurality ofconnections that are to be established; and instructions for writing theconnect request descriptor to a reserved portion of input/outputaccessible memory of the host system.
 16. The computer program productof claim 11, wherein the fourth instructions for informing the hostsystem of the established connection only after the connection isestablished within the offload network adapter include: instructions fordetermining if a delay criteria has been met; and instructions forwriting a connection completion response descriptor to a reservedportion of input/output accessible memory of the host system if thedelay criteria has been met.
 17. The computer program product of claim16, wherein the delay criteria is at least one of a predetermined numberof connections being established since a last connection completeresponse descriptor was written to the reserved portion of input/outputaccessible memory, a predetermined amount of data arriving over aconnection, a predetermined data pattern being detected in receiveddata, a predetermined amount of time since a last connection completeresponse descriptor was written to the reserved portion of input/outputaccessible memory.
 18. The computer program product of claim 11, furthercomprising: fifth instructions for migrating state information for theconnection from the offload network adapter to the host system.
 19. Thecomputer program product of claim 18, wherein the fifth instructions formigrating state information for the connection from the offload networkadapter to the host system include: instructions for generating aconnection attribute response descriptor identifying the sate of theconnection; and instructions for writing the connection attributeresponse descriptor to a reserved portion of input/output accessiblememory of the host system.
 20. The computer program product of claim 11,wherein the request for establishing a connection with a second dataprocessing system is a listen request, and wherein the thirdinstructions for establishing the connection with the second dataprocessing system include instructions for identifying connectionrequests received for a designated port number.
 21. A system forestablishing a data communication connection between data processingsystems, comprising: means for receiving, in a host system of a firstdata processing system, a request for establishing a connection with asecond data processing system; means for forwarding the request to anoffload network adapter associated with the first data processingsystem; means for establishing, within the offload network adapter, theconnection with the second data processing system; and means forinforming the host system of the established connection after theconnection is established within the offload network adapter.
 22. Thesystem of claim 21, wherein the means for forwarding the request to anoffload network adapter includes: means for generating a connectionestablishment request descriptor based on the received request; andmeans for writing the connection establishment request descriptor to areserved portion of input/output addressable memory in the host system.23. The system of claim 21, wherein the means for establishing theconnection with the second data processing system includes: means forgenerating, within the offload network adapter, a data structuredescribing the connection; and means for storing state information forthe connection in the data structure.
 24. The system of claim 21,wherein the means for informing the host system of the establishedconnection includes: means for generating a connection completionresponse descriptor; and means for writing the connection completionresponse descriptor to a reserved portion of input/output accessiblememory of the host system.
 25. The system of claim 21, wherein therequest is a request to establish a plurality of connections, andwherein the means for forwarding the request to an offload networkadapter associated with the first data processing system includes: meansfor generating a connect request descriptor identifying each of theconnections in the plurality of connections that are to be established;and means for writing the connect request descriptor to a reservedportion of input/output accessible memory of the host system.
 26. Thesystem of claim 21, wherein the means for informing the host system ofthe established connection only after the connection is establishedwithin the offload network adapter includes: means for determining if adelay criteria has been met; and means for writing a connectioncompletion response descriptor to a reserved portion of input/outputaccessible memory of the host system if the delay criteria has been met.27. The system of claim 26, wherein the delay criteria is at least oneof a predetermined number of connections being established since a lastconnection complete response descriptor was written to the reservedportion of input/output accessible memory, a predetermined amount ofdata arriving over a connection, a predetermined data pattern beingdetected in received data, a predetermined amount of time since a lastconnection complete response descriptor was written to the reservedportion of input/output accessible memory.
 28. The system of claim 21,further comprising: means for migrating state information for theconnection from the offload network adapter to the host system.
 29. Thesystem of claim 28, wherein the means for migrating state informationfor the connection from the offload network adapter to the host systemincludes: means for generating a connection attribute responsedescriptor identifying the sate of the connection; and means for writingthe connection attribute response descriptor to a reserved portion ofinput/output accessible memory of the host system.
 30. The system ofclaim 21, wherein the request for establishing a connection with asecond data processing system is a listen request, and wherein the meansfor establishing the connection with the second data processing systemincludes means for identifying connection requests received for adesignated port number.